using System;
using System.Collections.Generic;
using System.Text;

namespace RapidHDL
{
    public class PipelineBus : Bus
    {
        public PipelineBus(Component poParentComponent, string psName, int piWidth)
            : base(poParentComponent, psName,piWidth + 2)
        {
            DefineNodeVector("stall", 1);
            DefineNodeVector("data_ready", 1);
            DefineNodeVector("data", piWidth);
        }

        public NodeVector DataReady
        {
            get { return this["data_ready"]; }
        }

        public NodeVector Data
        {
            get { return this["data"]; }
        }

        public NodeVector Stall
        {
            get { return this["stall"]; }
        }

        public void Join(PipelineBus poBus)
        {
            this.Stall.Join(poBus.Stall);
            this.DataReady.Join(poBus.DataReady);
            this.Data.Join(poBus.Data);
        }
    }
}
